package com.cuijq.ms.compose.v2;

/**
 * @author by CuiJQ
 * @Classname File
 * @Description File Description
 * @Date 2021/5/26 23:34
 */
public class File extends FileSystemNode {

  public File(String path) {
    super(path);
  }

  @Override
  public int countNumOfFiles() {
    return 1;
  }

  @Override
  public long countSizeOfFiles() {
    java.io.File file = new java.io.File(path);
    if (!file.exists()) {
      return 0;
    }
    return file.length();
  }

}
